﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace Interfaces.IngresoEgreso
{
    public partial class GraficaAnual : System.Web.UI.Page
    {
        protected void Page_PreInit(object sender, EventArgs e)
        {
            if (Session["BuscarMaster"] != null)
            {
                string res = (string)Session["BuscarMaster"];
                this.MasterPageFile = res;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.Identity.IsAuthenticated)
                FormsAuthentication.RedirectToLoginPage();
            if (Request.QueryString["Gestion"] != null)
            {
                
                int gest = Convert.ToInt32(Request.QueryString["Gestion"]);
                if (Processes.GestorIngresoEgreso.verificarExistencia(gest))
                {
                    Chart1.DataSource = Processes.GestorIngresoEgreso.getDatos(gest, 'I');
                    Chart1.Series[0].XValueMember = "Fecha";
                    Chart1.Series[0].YValueMembers = "Total";
                    Chart1.DataBind();

                    Chart2.DataSource = Processes.GestorIngresoEgreso.getDatos(gest, 'E');
                    Chart2.Series[0].XValueMember = "Fecha";
                    Chart2.Series[0].YValueMembers = "Total";
                    Chart2.DataBind();
                }
            }
        }
    }
}